// 动效管理类
export class EffectManager {
  constructor() {
    this.list = []// 保存动效物体的数组
  }
  static getInstance() {
    if (!this.instance) {
      this.instance = new EffectManager()
    }
    return this.instance
  }
  addObj(obj) {
    this.list.push(obj)
  }
  tickForEach(t) {
    this.list.forEach(i => {
      i.onTick(t)
    })
  }
  removeObj(obj) {
    const index = this.list.findIndex(target => target === obj)
    this.list.splice(index, 1)
  }
}